#author=guoff
#date  10:01
import requests
headers = {"Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
"Accept-Encoding":"gzip, deflate, br",
"Accept-Language":"zh-CN,zh;q=0.9",
"Cache-Control":"max-age=0",
"Connection":"keep-alive",
"Cookie":"个人cook信息",
"Host":"groupweb.chaoxing.com",
"Referer":"http://note.yd.chaoxing.com/pc/note_note/noteDetailLatest/9cdf5a06-11ca-407e-8381-2e830a186d6f",
"Sec-Fetch-Dest":"document",
"Sec-Fetch-Mode":"navigate",
"Sec-Fetch-Site":"none",
"Sec-Fetch-User":"?1",
"Upgrade-Insecure-Requests":"1",
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36"
 }
def getnews(bbsid,lastvalue=""):
    if lastvalue=="":
        r = requests.get("https://groupweb.chaoxing.com/pc/invitation/getReplyList?bbsid="+bbsid+"&uuid=6b7eabbd-6e7b-4161-9ebf-6b92842dea4f&tag=&order=2",headers=headers)
        # print(r.json())
        return r.json()
    else:
        r = requests.get(
            "https://groupweb.chaoxing.com/pc/invitation/getReplyList?bbsid="+bbsid+"&uuid=6b7eabbd-6e7b-4161-9ebf-6b92842dea4f&tag=&order=2&lastValue="+lastvalue,
            headers=headers)
        # print(r.json())
        return r.json()

# https://groupweb.chaoxing.com/course/topic/5816d8e9ea394cdc13367347ba2679f9/myTopic?courseId=211438375&classId=43246598




def getobj(obj="5816d8e9ea394cdc13367347ba2679f9",lastvalue=""):
    if lastvalue=="":
        r = requests.get("https://groupweb.chaoxing.com/course/topic/"+obj+"/getMyTopicList?lastValue=null&sortType=2",headers=headers)
        # print(r.json())
        return r.json()
    else:
        r = requests.get(
            "https://groupweb.chaoxing.com/course/topic/"+obj+"/getMyTopicList?sortType=2&lastValue="+lastvalue,
            headers=headers)
        # print(r.json())
        return r.json()



if __name__ == "__main__":
    #print(getnews()) #获取回复
    print(getobj())